package com.pf.exception;

import com.pf.enums.BaseResultEnum;
import lombok.Getter;
import lombok.Setter;

public class BusinessException extends RuntimeException {

    @Getter
    @Setter
    private Integer code;

    public BusinessException(Integer code, String msg) {
        super(msg);
        this.code = code;
    }

    public BusinessException(BaseResultEnum baseResultEnum) {
        super(baseResultEnum.getMsg());
        this.code = baseResultEnum.getCode();
    }
}
